﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BL;
using BaseUI;
using Data;
using IUI;

namespace WebUI
{
    public partial class LoginPage : //System.Web.UI.Page
                                    BaseWebPage<LoginController>, ILogin
    {
        protected void Page_Load(object sender, EventArgs e) { }
        
        private event EventHandler _click_LoginButton;
        
        protected void btn_Login_Click(object sender, EventArgs e)
        {
            if (_click_LoginButton != null) _click_LoginButton(this, null);
        }

        #region Члены ILogin

        public string strLogin
        {
            get { 
                return txtBx_Login.Text; 
            }
        }

        public string strPasswd
        {
            get { 
                return txtBx_Passwd.Text; 
            }
        }

        public EventHandler Click_LoginButton
        {
            get { return _click_LoginButton; }
            set { _click_LoginButton = value; }
        }

        public void ShowError()
        {
                this.lbl_error.Text = "Login State : Check Login and Password";
        }

        public void Success(User us)
        {
            this.Response.Redirect("/MainPage.aspx?" + "login=" + us.Name);
        }

        #endregion        
       
    }
}
